package com.qf.taobei.exception;

import com.qf.taobei.entity.Product;
import com.qf.taobei.entity.RespBean;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 处理全局异常
 */
@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler{

    @ExceptionHandler(value = LoginException.class)
    public RespBean loginExceptionHandler(LoginException e){
        return RespBean.respFailure(e.getMessage());
    }

  /*  @ExceptionHandler()
    public RespBean globalExceptionHandler(ProductException e){
        return RespBean.respFailure(e.getMessage());
    }
*/
}
